home *** CD-ROM | disk | FTP | other *** search
- Path: news1.cris.com!news
- From: aubrey@concentric.net (Aubrey Harrison)
- Newsgroups: comp.lang.c
- Subject: Re: What to do when feof() is NOT feof()
- Date: 17 Feb 1996 16:29:45 GMT
- Organization: Concentric Internet Services
- Message-ID: <4g4vpp$52f@spectator.cris.com>
- References: <824554814snz@metsys.demon.co.uk>
- NNTP-Posting-Host: cnc022032.concentric.net
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.6
-
-
- I think if you open the file in "text" mode the end of the file is indicated by
- the EOF marker (ASCII 26 I believe). To avoid this you must open the file in
- binary mode.
-
- In article <824554814snz@metsys.demon.co.uk>, John@metsys.demon.co.uk says...
- >
- >I have a function in a program which is reading each character
- >in a file of some 700k characters.
- >
- >The do{ while !feof(in) sometimes causes the function to terminate
- >very early in the file.
- >
- >I wrote a utility to read the file and give the line number of
- >feof(in)......it returns ffff sometimes as early as line 200 in
- >a 30,000 line file.
- >
- >Any have any suggestions on the best way of coding a
- >
- >do{
- >
- >}while not the real feof(in) ignore all other feof(in)'s
- >
- >
- >These files get the data via radio, satellite, long distance telephone,
- >etc, somewhere they get the feof as a corrupt character.
- >
- >So there could be any number of EOF's in the file.
- >
- >John
- >--
- >Douglas John Standen
-
- --
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Aubrey Harrison aubrey@concentric.net 75320.1606@compuserve.com
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Loneliness is to endure the presence of one who does not understand.
- -Elbert Hubbard (1856-1915)
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-